package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.vo.CommentNumVO;
import com.lanchetech.bean.vo.CommonCommentVO;
import org.apache.ibatis.annotations.Param;

import com.lanchetech.entity.CommonComment;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface CommonCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(CommonComment record);

    int insertSelective(CommonComment record);

    CommonComment selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(CommonComment record);

    int updateByPrimaryKey(CommonComment record);

    int updateFirstCommentIdById(@Param("updatedFirstCommentId") Long updatedFirstCommentId, @Param("id") Long id);

    int updateFirstCommentIdAndFeatureById(@Param("updatedFirstCommentId") Long updatedFirstCommentId, @Param("updatedFeature") String updatedFeature, @Param("id") Long id);

    List<CommonCommentVO> findAllPage(PageReq req);

    CommonComment findCommentLastOne(Long rid);

    int addCommentCount(Long id);

    int reduceCommentCount(Long id);

    int deleteByRid(@Param("rid") Long rid);

    List<CommonComment> findAllByRid(@Param("rid") Long rid);


    List<CommonComment> findAllByIds(@Param("list") List<Long> list);

    List<CommonComment> findAllByRelateIds(@Param("list") List<Long> list);

    List<CommentNumVO> findCommentNum(List<Long> collect);

    Long countByRelateId(@Param("relateId")Long relateId);


}